#pragma once

#include <stdio.h>
#include <string.h>

class Eigenstructure {
private:
    void setFromFile(int N, FILE* file);
    int N;
    int K;
    double* values;
    double* vectorsInverse;
    double* pav[3];
    double* x[3];

    double& xRef(int ik, int iK, int m, int n) const;
public:
    double getVectorInverse(int iK, int iP) const;
    double getPav(int ik, int iK, int m, int n) const;
    double getx(int ik, int iK, int m, int n) const;

    void print();
    void printFile();

    //reads the precomputed eigenstructure file and returns an array of Eigenstructures
    static Eigenstructure* readFile(int& Nmax);
};
